package com.example.sso.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.sso.server.dao.SysAccountDao;
import com.example.sso.server.entity.SysAccount;
import com.example.sso.server.service.SysAccountService;
import org.springframework.stereotype.Service;

/**
 * (SysAccount)表服务实现类
 *
 * @author makejava
 * @since 2024-02-21 09:56:10
 */
@Service("sysAccountService")
public class SysAccountServiceImpl extends ServiceImpl<SysAccountDao, SysAccount> implements SysAccountService {

    @Override
    public SysAccount selectByAccount(String name) {
        if (name == null || "".equals(name)){
            return null;
        }
        LambdaQueryWrapper<SysAccount> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysAccount::getAccountName, name);
        return getOne(queryWrapper);
    }
}

